@import './app/sidebar.less';
@import './app/webview.less';

.app-page {
	cursor: default;
	user-select: none;

	background: @primary-background-color;

	&.app-page--loading {
		.loading-indicator {
			display: flex;
		}

		.add-server-form {
			display: none;
		}
	}

	.hidden {
		display: none !important;
	}

	.loading-indicator {
		.loading-component;
		display: none;
	}
}

.only-offline {
	display: none;
}

body.offline .add-server-form *:not(.only-offline) {
	display: none;
}

body.offline .only-offline {
	display: block;
}

.wrong {
	-webkit-animation: wrong 1s;
	animation: wrong 1s;
}

@-webkit-keyframes wrong {
	0%,
	100% {
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}

	10%,
	30%,
	50%,
	70%,
	90% {
		-webkit-transform: translate3d(-10px, 0, 0);
		transform: translate3d(-10px, 0, 0);
	}

	20%,
	40%,
	60%,
	80% {
		-webkit-transform: translate3d(10px, 0, 0);
		transform: translate3d(10px, 0, 0);
	}
}

@keyframes wrong {
	0%,
	100% {
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}

	10%,
	30%,
	50%,
	70%,
	90% {
		-webkit-transform: translate3d(-10px, 0, 0);
		transform: translate3d(-10px, 0, 0);
	}

	20%,
	40%,
	60%,
	80% {
		-webkit-transform: translate3d(10px, 0, 0);
		transform: translate3d(10px, 0, 0);
	}
}

.add-server-view {
	position: fixed;
	z-index: 1;
	top: 0;
	right: 0;
	bottom: 0;
	left: 68px;

	display: flex;
	overflow-y: auto;

	text-align: center;

	background-color: @primary-background-color;
	align-items: center;
	-webkit-app-region: drag;
	justify-content: center;

	.hidden {
		display: none;
	}

	&.hide {
		display: none;
	}

	.logo {
		max-width: 520px;
		-webkit-user-drag: none;
	}

	.wrapper {
		position: relative;
		z-index: 10;

		min-width: 600px;
		padding: 45px 0 35px;

		text-align: center;
		-webkit-app-region: no-drag;
	}

	.share {
		min-height: 40px;

		border-radius: 50%;

		line-height: 20px;

		&::before {
			border-radius: 50%;
		}

		span {
			display: none;
		}
	}
}

.add-server-form {
	position: relative;
	z-index: 1;

	width: 90%;
	max-width: 520px;
	margin: 25px auto;
	padding: 22px 30px 30px;

	border-radius: 2px;
	background-color: #fafafa;
	box-shadow: 0 0 6px 10px rgba(0, 0, 0, 0.1);

	header {
		padding: 18px 0;

		p {
			margin: 8px 0 0;

			font-size: 14px;
			font-weight: 300;
			line-height: 22px;
		}
	}

	h2 {
		margin: 0;

		color: @primary-font-color;

		line-height: 24px;
		&:extend(.rocket-h2);

		&.error {
			color: #b40202;
		}
	}

	h3 {
		&:extend(.rocket-h3);

		&.error {
			color: #b40202;
		}
	}

	img {
		width: 200px;
	}

	.input-text {
		position: relative;

		margin: 0 0 14px;

		input {
			position: relative;

			padding: 4px 8px;

			border-width: 0;
			border-bottom: 1px solid #dfdfdf;
			background-color: transparent;
			box-shadow: 0 0 0;

			font-size: 22px;
			font-weight: 400;

			&.error {
				border-bottom: 1px solid #b40202;

				&::-webkit-input-placeholder {
					color: #b40202;
				}

				&:-moz-placeholder {
					color: #b40202;
				}

				/* Firefox 18- */

				&::-moz-placeholder {
					color: #b40202;
				}

				/* Firefox 19+ */

				&:-ms-input-placeholder {
					color: #b40202;
				}
			}
		}

		input:-webkit-autofill {
			color: #ffffff !important;
			background-color: transparent !important;
			box-shadow: 0 0 0 1000px #f4f4f4 inset;
		}
	}
}

.drag-region {
	position: absolute;

	width: 100%;
	height: 22px;
	-webkit-app-region: drag;
}
